<?php 
HeaderScripts::addScripts(array(
	'site/carousel.js'
));
HeaderScripts::addStyles(array(
	'site/carousel.css'
));
?>
<input type="hidden" value="<?php echo intval($count) ?>" id="carouselItemCount" name="carouselItemCount"> 
<ul class="carousel jcarousel-skin-tango" id="mycarousel">
	<?php $odd = true; ?>
	<?php if ($count > 0) {?>
		<?php foreach ($data as $item) {?>
	<li><div class="carouselItem<?php echo ($odd ? ' odd' : ' even') ?>">
		<table class="carouselSimple">
			<tr>
				<td class="carouselItemHeader">
				<?php if (isset($titleDetailes) && $titleDetailes) { ?>
					<div class="titleName"><a href="<?php echo $detailedUrl ?><?php echo $item->id ?>/"><?php echo htmlspecialchars($item->title) ?></a></div>
					<div class="titleDetailes"><?php echo $item->titleDetailes ?></div>
				<?php } else { ?>
					<a href="<?php echo $detailedUrl ?><?php echo $item->id ?>/"><?php echo htmlspecialchars($item->title) ?></a>
				<?php } ?>
				</td>
				<?php if (isset($photos) && $photos) {?>
					<?php $photo = SiteLayout::showPhoto($photos, $item->id, $entity) ?>
					<?php if ($photo != '') {?>
				<td rowspan="2" style="width: 100px;"><a href="<?php echo $detailedUrl ?><?php echo $item->id ?>/"><?php echo $photo ?></a></td>
					<?php }?>
				<?php } ?>
			</tr>
			<tr>
				<td class="carouselItemDescription">
				<?php if ($item->description != '') { ?>
					<?php echo SiteLayout::textDelimiter($item->description, $detailedUrl . $item->id . '/') ?>
				<?php } ?>
				</td>
			</tr>
		</table>
		<?php $odd = ($odd ? false : true) ?>
	</div></li>
		<?php } ?>
	<?php } ?>
</ul>